/* Copyright (c) 2016-2020 Enfry Ltd. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Enfry. 
 * You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Enfry.
 */
package com.enfry.storage.exception;

import com.jweb.framework.core.CoreRuntimeException;
import com.enfry.storage.exception.ExCode;

/**
 * 异常类 <br>
 * 此类继承com.jweb.framework.core.CoreRuntimeException类，JWeb框架才可处理异常信息。<br>
 * @Title com.enfry.storage.exception.StorageException
 * @author liulei
 * @date 2016年7月25日
 */
public class StorageException extends CoreRuntimeException {
    
    private static final long serialVersionUID = -1687559187638747267L;
    
    private int storageCode = 0; //文件存储内部错误代码
    
    public StorageException(ExCode exCode) {
        super(exCode.getCode(), exCode.getMsg());
    }
    
    public StorageException(ExCode exCode, int storageCode) {
        super(exCode.getCode(), exCode.getMsg()+"，内部代码："+storageCode);
    }
    
    public StorageException(ExCode exCode, Throwable throwable) {
        super(exCode.getCode(), exCode.getMsg(), throwable);
    }
    
    public StorageException(String code) {
        super(code);
    }

    public StorageException(String code, Object[] arguments,
            Throwable throwable) {
        super(code, arguments, throwable);
    }

    public StorageException(String code, Object[] arguments) {
        super(code, arguments);
    }

    public StorageException(String code, Throwable throwable) {
        super(code, throwable);
    }

    public StorageException(String code, String defaultMessage) {
        super(code, defaultMessage);
    }
    
    public String getCode() {
        return super.getMessage();
    }

    public int getStorageCode() {
        return storageCode;
    }

    public void setStorageCode(int storageCode) {
        this.storageCode = storageCode;
    }
}
